Database contradiction solution method

ABSTRACT

Provided is a database operation method which modifies references among database records. A record is fetched ( 0301 ), a reference destination record that is set to the record is specified ( 0302 ), “changing reference destination modification” that is set to the reference destination record is specified ( 0303 ), a reference destination modification process corresponding to the reference destination modification information is invoked ( 0304 ), and the newly obtained reference destination is set as a new reference destination of the fetched record ( 0305 ). Moreover, copies of the original database are created in plural number of computers and editorial contents on the copies are reflected to the original database by a database management method. A base version of a database is recorded for each record and editorial contents on newest base version are made to be valid.

TECHNICAL FIELD

The present invention dissolves structural inconsistency of theinformation recorded on the database.

BACKGROUND ART A General Background Art

Information contained in a database (DB) is a collection of recordshaving references to other records in many cases. Referential integrity(see non-patent literature 1) means consistency of references of arelational database (RDB). Reference is a general concept common tovarious DBs expressing the relation among records. Object-oriented DBsalso have referencing and referred records.

Some DBs have “chain delete function” or “chain update function” thatdelete or update other records in consequence of a deletion ormodification of one record.

However, these referential integrity functions sometimes deleteunexpected records, or do not modify records as expected. It is possibleto disable referential integrity functions of DBs and implements similarfunctions on a user program that are invoked at their own triggerevents. However, such program has to search all records havingpossibility to be deleted or updated, and needs heavy processing powers.

<DB Operation Types>

DB operation types are classified into the followings that areintroduced just for simple explanations of this specification.

Single DB access: Only one computer accesses a DB.

Server DB access: Only one server computer accesses a DB. Other terminalcomputers first access the server that directly accesses records of aDB. It is equivalent with single DB access, from the view point that aDB is accessed directly by a single computer.

Parallel DB access: Original DB is copied to plural number of computers,of which reproduced DBs will be concurrently edited. And the original DBwill be updated by reflecting these editorial contents. It is common toput the original DB on specific computer, such as server or a computerwhich performs administrative tasks. Because DB is concurrently accessedby plural number of computers, Parallel DB access is different form“single DB access” and “server DB access”. Range of DB reproduction iswhole DB in some cases, or only a portion required for the present workin other cases. Subdividing original DB beforehand, it is possible toreduce operation tasks to update reproduced DB, i.e., operation tocoincide the contents of reproduced DB with the original DB.

<Structural Inconsistency of DB>

If the inspection of referential integrity is omitted to improve speedof processing, structural inconsistency will be made, such that“referred record does not exist”, or “mistaken reference being set up”and so on. If these inconsistencies are left, it will be impossible tocontinue processing when program encounters them. This situation mayoccur at all DB operation types mentioned above.

Structural inconsistency is fate for parallel DB access, because it isimpossible to investigate reproduced DB in other computers just beforeediting a reproduction DB. For example, there is a possibility todeleted or change a record, which is referred by other records of othercomputers. These inconsistencies are spread over reproduced DBs of othercomputers, by updating the original DB and synchronizing reproduced DBswith the original DB.

Plural computers probably concurrently edit same record in parallel DBaccess.

Updating the original DB by these edit contents, inconsistency will befound out. This is also “structural inconsistency of the informationrecorded on DB.”

<Current State of Parallel DB Access>

The system, “Power up news paper sales”, which was developed underdirections by the author of this specification, permits parallel accessonly for read accesses. It blocks parallel write accesses, forcingcomputers to get “editorial right” before starting their edits to DB.This is called an “edit lock” in this specification.

Investigations about parallel DB access are explained below. MVCC(non-patent literature 1), which is one of on-line DB software, usesonly “edit lock” for resolving edit competitions (non-patent literature2 and 3), though it makes copy (a part) of DB for read access. Cache(non-patent literature 4) and ObjectStore (non-patent literature 5),which are OODB, use only “edit lock” for avoiding parallel editing work.PostgreSQL of RDB uses “SELECT FOR UPDATE” or “LOCK TABLE” command foravoiding simultaneous edits (non-patent literature 6), which is a “editlock”. Patent document 1 also uses “edit lock”.

Patent documents 2, 3, 4, 5, and 6 were investigated, and neither isinapplicable to resolve inconsistency by parallel edit of DB. ADO.NET ofMicrosoft moves one step toward parallel DB access from operation ofserver DB access. It copies data required for the present work to aterminal computer from a server, and after it cuts connection with theserver computer, it performs editing work. It connects with the servercomputer again after editing work, and editorial contents are sent up tothe server computer. If the original contents are already changed fromother terminal computers, the editorial contents will be invalid. Thisis called “optimistic concurrency control” (non-patent literature 7 and8).

Although optimistic concurrency control is a kind of parallel DB access,there are two problems. One problem is that it ignores a possibility ofinconsistency about referential integrity. For example, suppose that aterminal computer copied a record (R) from a server, deleting it, andnotified it to the server about 10 seconds later from the copying time.This deletion will be valid, if there is no edit notification about R toserver from other terminal computers during the 10 seconds period.However, if the reference to R from other records remains, or ifreference is newly set up within above-mentioned 10 seconds, structuralinconsistency will occur.

Another problem is that judgment based on the latest information will beinvalid in some cases. It is a problem in actual DB operation, becausethe judgment based on the latest information might be the best.

For example, the operator of “computer A” wrote at 9:00 in the morningthat “no need to send kind correspondence to this customer, he is abanter”, and left for a while. On the other hand, the operator ofcomputer B acquires information that “the customer proposed big-ticketdealings” at 12:00 noon, writes in “The maximum entertainment should beperformed to get a contract”, and send it up to the server. However, if“computer A” sends its editorial contents up to the server just oneminute before, the edit by computer B will become invalid. This is thesituation where “computer A” cannot oppose capricious operation of theoperator of “computer B”.

Patent document 7 uses editorial time to reproduction databases andmanipulates versions of edits such that, “re-number version number so asto increase from the early time (Step S604)”, (paragraph 0065 and 0097of patent document 7), and “the latest version will be assigned to theoldest time of contents (paragraph 0097). That is, the previous edit haspriority.

There is also a problem, even if earlier edit has priority. For example,suppose that a computer holds edit result at a certain time (forexample, one year before). If it is sent up to a server suddenly one dayand becomes effective, all editorial contents done in the past one yearby other computers will be invalidity. It seems that such operation isnot usually allowed.

<The Limit of Conventional Technology>

Though edit lock prevents the competition of edit to a record, it cannotprevent inconsistency caused by parallel DB access, inconsistency willbe that, “there is no pointed record”, and “mistaken references are setup”. This structural inconsistency cannot be prevented by methods tochoose valid editorial contents checking editing time or sending up timeto the server. Thus, there will be problems such that “some editedrecords will be valid, though they are against operators expectations”.

<Conventional Technology about Referential Integrity>

Conventional technology about referential integrity was investigated.Patent document 8 removes restrictions of referential integritytemporarily and carries mass data entry, and after that, inspectsreferential integrity. Patent document 9 shows method to prevent anothercomputer reading broken state of referential integrity temporarygenerated during editing work. Neither is inapplicable to the subject ofthe present invention.

When the main table changes, patent document 10 immediately notifies itto computers having record related to these changes. However, the serverDB access is more simple and clearer than complicated this notificationprocess. There is no value to use this kind of notification combinedwith the parallel DB access.

[Patent document 1] JP, 11-272534, A[Patent document 2] JP, 11-161535, A[Patent document 3] JP 2005-503606, A[Patent document 4] JP 2005-508050, A[Patent document 5] JP, 8-16447, A[Patent document 6] JP 2000-501532, A[Patent document 7] JP, 2005-216167, A[Patent document 8] JP, 2006-79260, A[Patent document 9] JP, 3185718, B[Patent document 10] JP, 3612449, B[Non-patent literature 1] “Main functions and merits”, [online], Apr.22, 2007 search, the Internet (URL:http://www.sonicsoftware.co.jp/products/object_store/function.html)[Non-patent literature 2] MVCC (multi-phase concurrency control), “9.1First”, [online], Apr. 22, 2007 search, the Internet(URL:http://www.postgresql.jp/document/pg721doc/user/mvcc.html #MVCC-INTRO)[Non-patent literature 3] “9.5. Consistency-of-data check in anapplication level”, [online], Apr. 22, 2007 search and the Internet(http://www.postgresql.jp/document/pg721doc/user/applevel-consistency.html)[Non-patent literature 4] “Cache Technology Guide”, [online], Apr. 22,2007 search, the Internet (URL:http://www.intersystems.co.jp/cache/technologyguide/technologyguide.html)[Non-patent literature 5] “Main functions and merits”, [online], Apr.22, 2007 search, the Internet (URL:http://www.sonicsoftware.co.jp/products/object_store/function.html)[Non-patent literature 6] “9.5. Consistency-of-data check in anapplication level”, [online], Apr. 22, 2007 search and the Internet(http://www.postgresql.jp/document/pg721doc/user/applevel-consistency.html)[Non-patent literature 7] “The outline of the data concurrency controlin ADO.NET”, January, 2007, MSDN subscription library (MSDNsubscriptions Library), Disk file, (URL:ms-help: //MS.MSDNQTR.v80.ja/MS.MSDN.v80/MS.VisualStudio.v80.ja/dv_raddata/html/d5293098-4a88-4110-abd2-34d9e6661664.htm)[Non-patent literature 8] “Tutorial: Processing of a concurrencyexception”, January, 2007, a MSDN subscription library (MSDNsubscriptions Library), A disk file, (URL: ms-help://MS.MSDNQTR.v80.ja/MS.MSDN.v80/MS.VisualStudio.v80.ja/dvraddata/htm/73ee9759-0a90-48a9-bf7b-9d6fc17bff93.htm)[Non-patent literature 9] “Referential integrity”, [online], January,2007, [Jun. 6, 2007 search], Internet(URL:http://www.leasekin.com/rodan/makepos/02ac2kintro/tablekihon/p010130sansyouseigousei.htm)

DESCRIPTION OF THE INVENTION Problems to be Solved by the Invention

If DB is edited without fully investigating the reference relation amongrecords in order to improve processing speed, “structural inconsistencyof the information recorded on the database” will arise. This is aproblem common to single DB access, server DB access, and parallel DBaccess.

In editing work of parallel DB access, it is evitable to generatestructural inconsistency of DB, such as, lack of referential integrity,collision record edit, and so on. When plural computers add records to atable concurrently, major keys may conflict each other. These are alsostructural inconsistency.

It is still reasonable to realize parallel DB access. Single DB accesshas a problem in data sharing with other computers. Server DB access hasfatal defect that “information cannot be accessed in the situation whenconnection to the server is broken”. Telecommunication is frequentlyimpossible in a mobile situation. Mission critical business should bedone, even if telecommunication is impossible. Delay caused bycommunication with server is also a problem.

There was no practical parallel DB access method for both reading andwriting though it is ideal, because there was no reasonable method ofsolving “inconsistency of database structure caused by editing work onDB”. The present invention shows new method that permits temporal“structural inconsistency recorded in the database” and resolves it whenneeded.

Means for Solving the Problem <Introduction of Changing ReferenceDestination Information>

Operator of DB has clear intention how reference relation among recordsshould be changed, and edits DB according to the intention. There willbe no inconsistency if all the related references are changed as theintention. Since processing load will be huge if it is performedimmediately after editing work on DB, the present invention specifies(writes) “changing reference destination information” to edited records.When reference to this record is detected, reference destination ischanged (by the program) according to the directions of this “changingreference destination information.” Detailed explanation is shown below.

Setting a “Changing reference destination information” to a record is tospecify a new record to which (other) records referring to this recordshould newly refer. At this time, “deleted mark” is attached to a recordwith “changing reference destination information”. Record with deletedmark is not displayed. It seemed to be the record is truly deleted foroperator. This record will never be newly referred.

For example, a deleted mark is attached to the record “Tokyo” and therecord “Japan” which is a generic concept of “Tokyo” is specified as the“changing reference destination information” of “Tokyo”. It is anoperator's decision (or a program designer's decision) how changingreference destination information is specified. It is also possible todefine a new record of “Not appointed”. This record can be set as newreference destination of “changing reference destination information”.

Handling a record referring to “Tokyo” (by program), inconsistency ofthis record will be gradually canceled by changing reference destinationto “Japan” (or “Not appointed”) according to “changing referencedestination information”.

A set of records referred is called the main table in RDB. Changingreference destination of a record of this table might be another recordof this main table, or another record of another main table. In order toavoid an infinite loop of reference destination changes, there is anidea to create new main table and change a reference destination intothe new table.

“Revival” can be specified as an advanced type of changing referencedestination information. Suppose that deleted mark is attached to acertain record, of which “changing reference destination information” is“revival”. When a record referring to this record is detected, thisrecord is revived by eliminating a delete mark.

Revival is possible, because deletion by attaching “deleted mark” islogical deletion and not actual deletion. Actual deletion of records canbe postponed to the situation where record with delete marks becomesabundant and memory runs out by prolonged operation.

There is no problem if all changing of reference destinations arecompleted before actual deletion of records. If some changing ofreference destinations are left to be not completed, a program willdetect that a reference destination was actually deleted and a messageis displayed. It will not become a big problem even if an operatorspecifies new reference destination, if few changing are left. If actualdeletion will be done when there is less load of processing, there is noproblem even if complete investigation and complete changing ofreference destinations are done.

It is not necessary to specify “changing reference destinationinformation”, if there is no necessity of correcting references causedby changing some records. As for records with city names, there is nonecessity of changing references when “Tokyo” is changed to “TokyoMetropolitan”.

Above is explained the method to permit generating inconsistency ofreferential integrity temporary and to solve gradually when required.

<Resolving Collisions Among Editing Work>

There may be a collision when a record is edited under parallel DBaccess. Although it is necessary to explain including a relation withchanging reference destination information, first of all, a method ofsettlement of a simple collision is shown.

The present invention shows a mechanism which adopts editorial contentsto the latest information, on the contrary to “optimistic concurrencycontrol” or patent documents 7 that show mechanisms to use send-up-timeto server or time of editing work.

Processes are as follow. (a) Update a version of the DB, wheneveroriginal DB is updated. (b) When making a copy from the original DB to acomputer, set version number of the original DB to the reproduced DB asbase version of it. (c) When a computer sends up the editorial contentson the reproduced DB to a computer (for example, server) managing theoriginal DB, it also notifies (sends up) the base version of thereproduced DB. (d) When it collides with editorial contents from otherterminal computers, editorial contents on reproduction DB with higherbase version will be adopted. (e) If there are plural edits with samebase version, one sent up earlier will be adopted. As a simpleimplementation, a computer (for example, server) managing original DBperforms can perform above (d) (e). But another computer can performthem or plural computers share them, if the same result is obtained.

An editing computer performs a series of following steps. (Step 1) Makea reproduced DB by copying the original DB, or synchronize reproduced DBwith the latest original DB. (Step 2) Edit the reproduced DB. (Step 3)Editorial contents over reproduction DB and version of it are sent up toa computer that manages original DB. Computer managing the original DBmakes decisions on adoption of editorial contents by (d) and (e)mentioned above, after (Step 3). During (Step 2), there is no necessityto keep connection with a computer that manages original DB,

Suppose that computer B sends up editorial contents, while “computer A”is doing (Step 1) and (Step 2). In this situation, the computer thatmanages the original DB first set valid to editorial contents from B andupdate version of the original DB. When the editorial contents of A aresent up, it will be done to decide which editorial contents haspriority. Comparing base versions of editorial contents of A and B,editorial contents with the latest base version will be adopted. Ifeditorial contents of A are adopted, edition of B will be invalid. Ifboth have same base versions, edition of B is adopted because it is sentup earlier, and editorial contents of A will be invalid.

If a base version of the original DB is newer than that of editorialcontents at the send-up-time of said editorial contents, there is apossibility that another edit of newer base version might be sent uplater and it might be valid.

On the contrary, if a base version of editorial contents is equal with aversion of original DB at the send-up-time of said editorial contents,there is no possibility that another editorial contents of newer baseversion might be sent up later. This sending up is the first one amongeditorial contests for the same base version. Therefore, this sending upis adopted, the original DB is updated and, as a result, a version ofthis is updated only one.

If process at editing computer from (Step 1) to (Step 3) is done for avery short time, a possibility will be very small that a result of othereditorial contents will be sent up and interrupt the process. After(Step 3), a reproduced DB is synchronized with the original DB, and aversion of the original DB is acquired and set as a base version of thereproduction DB.

If base version is updated just one at this time, this computer canconfirm that a previous result of editorial contents is set valid.Conversely, if the base version is updated more than two, there will bea possibility that the previous result of editorial contents becomesinvalid or already invalid.

If process from (Step 1) to (Step 3) is done for a very short time, itbecomes operation very close to on-line operation (such as server DBaccess). It is useful to edit a record, to which competitive editorialcontents are expected.

On the contrary, when treating a record with very few possibilities ofcompetitive editing work, a period of (Step 2) can be lengthenedextremely, sufficient time for an input or editing work can be spent,and (Step 3) can be performed after it. Of course, while (Step 2), thereis no necessity to keep connection with computers (for example, serveretc.) managing the original DB.

For example, in a case which inputs debit slips of each organization ofa company, a record will be edited when an input mistake and mishandlingare discovered. Even if corrections are required, it will be done by thesame computer that input original records in many cases.

In those cases, off-line operation with huge long period of (Step 2) hasno problem. Even if we cannot connect with internet, we can input debitslips slowly. We can send them up as Step 3 when settlement of accountsor inspection becomes near.

Even if structural inconsistency of DB occurs by parallel editing work,inconsistency should be canceled by applying a method of the presentinvention (also including a method explained after this), when required.

As stated above, an operation near on-line or near off-line can beselected only by setting an execution cycle of (Step 1) to (Step 3).These two operations can exist simultaneously. These are some of goodpoints of the present invention that resolves editorial collisions byassigning higher priority to editorial contents to the latestinformation. And, only changing an execution cycle from (Step 1) to(Step 3), a terminal computer can perform almost on-line at somespecific time and almost off-line at another time. Mixture operation isalso possible that a certain terminal computer is operated as almoston-line, and another terminal computer is operated as almost off-line.

In a method of “optimistic concurrency control” and patent documents 7,as explained previously, information send up from a computer of “beingalmost off-line operation” might block information send up from acomputer of “being almost on-line operation.” However, as for editingwork to the same record, priority is given to a result of editing workby “being almost on-line operation”, if the present invention isemployed that priority is assigned to editing work on the newestinformation. What is necessary is just to perform as almost off-lineoperation, if you would like to validate results of editing work. Whatis necessary is just to perform as almost off-line operation, if youtreat records with little competition of editing work, and wants to omitcommunication efforts and time.

It is easy to understand by man that we perform process from (Step 1) to(Step 3) for a short time to validate results of editing work, becauseit is very close to human sense that priority is given to judgment(editing work) based on newer information. This property is suitable foractual DB operation on which many persons make connections. This isanother good point of resolving collision of editing work by “settingpriority on editing work to newer information”.

By mechanism described above, simple competition of editing work to arecord is resolved. Here, simple competition means that there is norecord referring the records. Although versions were given to theoriginal DB at above descriptions, versions can be set to tables orrecords of the original DB and used for managements. This is equivalentwith subdividing the original DB.

<Resolving Collision of Changing Reference Destination Information>

Consideration is still required for collisions of editorial contents torecords to be referred. For explanation, suppose that edit X and edit Ycollide with each other, i.e., both set different “changing referencedestination information” to same record. Suppose that edit X was adoptedby a mechanism that higher priority is set to editorial contents tonewer information.”

The problem is that a reference destination of some records will bechanged by “changing reference destination information” set by edit Y,before judging that edit Y is invalid. An example is shown. Suppose thata computer made editorial contents Y. Here, Y changed referencedestinations of some records by applying “changing reference destinationinformation” by the editing work. After that, editorial contents Ybecomes invalid, when editorial contents Y are sent up and editorialcontents X are decided as valid. There is no guarantee that referencechanging only by editorial contents X is equivalent with referencechanging by first editorial contents Y and editorial contents X.

A process which solves this problem is shown below. After editing arecord which can be referred, first this editorial contents should besent up and update reproduced DB by synchronizing it with the originalDB, before changing references in this computer based on changingreference destination information. After confirming that the editorialcontents are valid, that is the base version is updated only one,references will be changed by applying reference destinationinformation.

For the previous example, the computer that sent up editorial contentsX, will check that editorial contents X have been adopted, and thenchanges references based on said editorial content. The computer thatsent up editorial contents Y, can see that editorial contents Y becomeinvalid and editorial contents X are adopted. If necessary, it will editagain. It can change references by using editorial contents X.

When there are multiple changes to one record, it will makeinconsistency, if intermediate changing reference destinationinformation is skipped and only last one is used for changing referencedestination. Thus, base version (of reproduction DB) at a time ofconfirming or setting a reference should be recorded.

It is possible to record a base version for each reference when a recordhas plural references, but has a problem that management might becomplicated because of huge information. And, this version will bewritten (recorded) to each record as record version that is a versionwrote (recorded) to a record.

When a record is newly created, or when the contents of the record arepartly changed, a base version (of reproduction DB) at the time isrecorded (and updated) as a record version. Since setting or changing ofreference destination is also changes of the contents, a record versionis updated. When (at least one) reference destination is changed, orwhen the other changes are made, all the references of the record arechecked. If changing reference destination information is set to areferenced record, a reference destination will be changed according toit. As a result, all references of this record were updated or checkedin the reproduced DB of the base version recorded in the record.

Adding a record, a major key (ID) will be given to the record by theabove structure.

Actually, DB has a record (K) that keeps the following major key. Newrecord (Z) uses value of K as a major key, and a value of K is updatedafter that. Addition of a record will be completed, if renewal of K isvalid by the rule “priority is set to editing work with newerinformation”. Addition of new record (Z) becomes invalid, when editorialcontents K was decided as invalid and renewal of a value of K becomesinvalid.

However, (Step 1) to (Step 3) should be done quickly for validatingadding new record. It will narrow applicability of almost off-lineoperation. Therefore, when almost off-line operation is important, rangeof a major key (ID) should be assigned to each computer beforehand,where these range have no overlap.

EFFECT OF THE INVENTION

By the method using the changing reference destination information ofthe present invention, inconsistency of the referential integritygenerated temporarily is gradually resolved, when required. And, processof editing work on DB becomes high-speed because there is no need toinspect of referential integrity for every editing work.

The collisions among editing work by parallel DB access can be resolvedreasonably by the method that higher priority is assigned to editingwork to newer information.” By this method, almost on-line or off-lineoperation can be freely changed according to the character ofinformation to be treated. It is also the big feature that computers ofdifferent operations (almost on-line or off-line operation) can worktogether via a server, and it gives big flexibility when pluralcomputers share a DB.

By combining “the method using changing reference destinationinformation”, and “the method that higher priority is assigned toeditorial contents for newer information”, the inconsistency generatedby editing work by parallel DB access is resolved reasonably. Effect isdemonstrated especially when we edit records which might be referred.

Parallel DB access has strong points, such as that “communication withother computers via DB is possible”, and “it is possible to handle DBeven if communication to outer is impossible”, and “there is no delay ofresponse by communication with a server”. However, it was difficult toimplement parallel edits, because there was no method to resolveinevitable structural inconsistency. The present invention resolvesthese problems and make possible to implement practical parallel DBaccess systems. This invention can be applied to mobile DB access ormission critical business. It is also effective for cases reducing costand effort to connect to networks every time.

BRIEF EXPLANATION OF FIGURES

FIG. 1 is a composition of a popular computer.

FIG. 2 is the composition of computer as a set of a means which providesfunctions realized by programs.

FIG. 3 is the process of changing a reference destination.

FIG. 4 is the process to set “changing reference destinationinformation”.

FIG. 5 is the process of a terminal-side computer to set priority toeditorial contents on the latest information.

FIG. 6 is the process of a server-side computer setting priority to editfor newer information.

FIG. 7 is the process of a terminal-side computer to edit records thathas possibility to be referred by other records.

FIG. 8 shows examples 1, 2, and 3 of reference destination changes.

FIG. 9 shows example 4 of reference destination changes.

FIG. 10 shows example 5 of reference destination changes.

FIG. 11 shows an example of the DB version management.

Description of Notations 0101 Computer 0102 Communication Unit 0103Arithmetic Unit 0104 Main Memory Unit 0105 DB (Database) in Main MemoryUnit 0106 Secondary Memory 0107 Input/output Unit 0108 Display Unit 0109Bus 0110 Communications Network 0111 DB (Database) in Secondary Memory0201 Transmitting Means 0202 Receiving Means 0203 Means for changingreference destination 0204 Means for setting “changing referencedestination information” 0205 DB (Database) 0206 Means for judgingvalidity of editorial contents 0301 Process to fetch record 0302 Processto specify “reference destination record” that is set to this record0303 Process to specify “changing reference destination information”that is set to said reference destination record 0304 Process invokingprocess to change reference destination corresponding to this changingreference destination information 0305 Process setting newly obtainedreference destination to the previously fetched (0301) record as newreference destination 0401 Process to fetch a record 0402 Process tospecify “changing reference destination information” 0501 Process tosynchronize reproduced DB with the original DB 0502 Process to recordversion of the original DB as base version of reproduced DB 0503 Editingwork on reproduced DB 0504 Judgment 0505 Process to send up editorialcontents and base version of DB edited to Server 0601 Process to fetch,in order, records that are edited and sent up 0602 Process to specifyrecord version (NRV) of this record 0603 Process to specify a recordversion (ORV) of the original record corresponding to this record 0604Comparison of record versions 0605 Process to make valid the record thatis newly sent up to at the original DB 0606 Process to update version ofthe original DB just one 0701 Process to edit a record which may bereferred to 0702 Process to send up base version (BV1) and editorialcontents to server 0703 Process to synchronize reproduced DB with theoriginal DB 0704 Process to acquire and record new base version (BV2)0705 Comparison of BV2 and BV1 0801 Sub Table 0802 Main Table A 0803Main Table B 0804 Term n 0901 Process to fetch a label of referencedestination record 0902 Process to confirm whether character string of“Head Office”, which is specified beforehand, is contained or not 0903Judgment 0904 Process to change reference destination 1001 Node P 1002Node R 1003 Node Q 1004 Process to specify node 1005 Process to checkwhether table and record are specified 1006 Process to change referencedestination of referring record 1007 Process to specify higher rankrecord 1101 Server 1102 Computer A 1103 Computer B 1104 Original DB 1105Reproduced DB (inside of A) 1106 Reproduced DB (inside of B) 1107Original of record X 1108 Reproduced record X (inside of A) 1109Reproduced record X (inside of B) 1110 Synchronization (create newreproduced DB in A) 1111 Synchronization (create new reproduced DB in B)1112 Synchronization (update No 1 on reproduced DB in A) 1113 Editingwork (to reproduced X by A) 1114 Sending editorial contents (from A toserver) 1115 Update of the original X (reflection of editing work bycomputer A) 1116 Confirmation (whether editing contents by A are valid)and synchronization 1117 Synchronization (update reproduced DB in B)1118 Editing work (to reproduced X in B) 1119 Sending editorial contents(from B to server) 1120 Update the original X (reflection of editorialwork by computer B) 1121 Confirmation (whether editorial contents by Bare valid) and synchronization 1122 Synchronization (update No 2 ofreproduced DB in A) 1123 Update the original X (reflection of editingwork by computer B)

BEST MODE OF CARRYING OUT THE INVENTION

It will be considered as common to implement methods described in claimsof the present invention as programs of a computer. FIG. 1 shows typicalcomposition of computer 0101. Arithmetic unit 0103, main memory unit0104, secondary memory 0106, input/output unit 0107, and display unit0108 are connected by bus 0109. When exchanging data with othercomputers, it connects to communications network 0101 via communicationunit 0102. The “database” which has been refereed by each claim is DB0111 in secondary memory 0106, or DB 0105 in main memory unit 0104.

Programs are recorded in secondary memory 0106, invoked and loaded tomain memory unit 0104, and arithmetic unit 0103 runs procedure specifiedby the programs. Thus, computer is reconstructed as aggregate of meansto realize operations that program developer intended. FIG. 2 showsfunctional constitution realizing methods described in claims.

As for operation of DB by programs, it is common to carry out, afterdeveloping the whole or a part of DB to main memory operation 0104. DB0105 which developed all or a part of DB 0111 in secondary memory 0106to main memory unit 0104 is operated, and the results of editorial workwill be written to DB 0111 in secondary memory 0106. However, it isnatural to suppose that DB is in secondary memory 0106, and argue withno distinction from DB 0105 developed to main memory unit 0104, FIG. 2shows DB 0205 as unified concept over both of them.

“Means for changing reference destination 0203” realizes “the process ofchanging reference into this record to another record by usinginformation set to this record” of claim 1, or “process of removing adelete mark if a reference to this record, to which the delete mark wasattached, is detected” of claim 2.

“Means for setting changing reference destination information 0204”realizes “the process of recording information that changes reference toa record into a reference to another record” of claim 3.

“Means for judging validity of editorial contents” (0206) realizes “theprocess to validate editorial contents of latest version among ‘pluralcombinations of editorial contents and base version, that is the versionof original DB when reproduced DB is made, and to reflected it to theoriginal database” of claim 4. This means should be in the computer withthe process of judging validity of edits (for example, computer whichmounts controlling functions, such as a server). Transmitting means 0201and reception means 0202 are used for communication among computers.

FIGS. 3 to 7 illustrate processes of claim 1 to claim 5. FIG. 1 showsthe process equivalent to claim 1. To process 0301 to fetch record, toprocess 0302 to specify reference destination record that is set to thisrecord, to process 0303 to specify “changing reference destinationinformation” that is set to said reference destination record, toprocess 0304 invoking process to change reference destinationcorresponding to this changing reference destination information, and toprocess 0305 setting newly obtained reference destination to thepreviously fetched (0301) record as new referenced destination. In theexplanation so far, thought the contents of this process “to changereference destination” is only to acquire the reference destination,others are explained in examples.

FIG. 3 also corresponds to the process of claim 2. First to process 0301to fetch record, to process 0302 to specify reference destination recordthat is set to this record, to process 0303 to specify “changingreference destination information” that is set to said referencedestination record, and to process 0304 invoking process to changereference destination corresponding to this changing referencedestination information. If “revival” is detected, the delete mark ofthis reference destination record will be removed. In this case, sincethere is no change in a reference destination, there is nothing at“process 0305 setting newly obtained reference destination to thepreviously fetched (0301) record as new referenced destination” (0305).

FIG. 4 is the procedure equivalent to claim 3. To process 0401 to fetcha record, to process 0402 to specify “changing reference destinationinformation”, that is to set information for changing reference to therecord into another record.

Editing computer performs procedure of FIG. 5, in order to implement themethod to “set priority to editorial contents for the latestinformation” of the present invention. First, synchronize 0501reproduced DB with the original DB. In an actual situation, there arecases to make new reproduced DB or to update it with differenceinformation. Process 0502 to record version of the original DB as baseversion of reproduced DB. And process 0505 to repeat editing work 0503on reproduced DB as required 0504, and to send up these editorialcontents. Here, “send up these editorial contents” means send upcontents of the editorial work and base version of DB edited to server.

Claim 4 is a process to judge validity or invalidity of editorialcontents sent up. A record version is recorded for every record in orderto specify editorial contents of a higher version. When a record iscreated, a base version (of reproduced DB) at that time is recorded as arecord version. When, at least a part of, the contents of the record arecorrected, a base version (of reproduced DB) at that time is recorded asa record version.

FIG. 6 illustrates a process of claim 4 in detail using this recordversion. To take 0601 out, in order, records which were edited and newlybe sent up, to specify 0602 record version (NRV) of said record, tospecify 0603 record version (ORV) of the original of said record, tocompare 0604 these record versions. When NRV>ORV, newly sent-up recordbecomes valid at original DB 0605. When NRV=ORV or NRV<ORV, newlysent-up record becomes invalid and proceed to the next process. Updateversion of the original DB just one, after above processes for all newlysent-up records. Example 6 explains version management in detail.

Claim 5 is a process of editing a record to which may be referred fromother records. FIG. 7 shows the flow. First, synchronizes 0501reproduced DB of a computer with the original DB, just like the processof FIG. 5. Simultaneously to record 0502 version of the original DB asbase version of reproduced DB.

Then, edit 0701 a record which may be referred, and this editorialcontents and base version (BV1) are sent 0702 up to server. Promptlyafter that, reproduced DB is synchronized 0703 with the original DB, newversion of the original DB is acquired and recorded 0704 as new baseversion (BV2). If 0705 BV2 is the next of BV1, move to the next processbecause editing work to said record, to that may be referred, has beencompleted. If “changing reference destination information” exist at thereference destination of a record that will we treated by the nextprocess, a reference destination will be changed according to this. If0705 BV2 is not the next of BV1, editing work on record, to that may bereferred, can be tried again.

Example 1 Example in which a Reference Destination is not Changed

FIG. 8 shows example of setting up of changing reference destinationinformation and process of changing. Sub table 0801 of FIG. 8 has pluralrecords and “term n” 0804 has reference to a record of the main table0804.

Record with ID=a of sub table 0801 refers to record with ID=1 of maintable A 0802.

Reference from a record of the sub table cannot be changed, since“changing reference destination information” of this record is “nosetting”.

Example 2 Example of Revival

In FIG. 8, specification of “display=False” is equivalent to a “deletionflag.” If a record is not displayed on a screen, it is the same as beingdeleted for a user. In main table A 0802, records with ID=2, 3, and 4are in deletion state (display=False). When processing a record withID=b of sub table 0801, “display=True” is set because “revival” isdetected while checking “changing reference destination information” ofthe record with ID=2 of main table A. Since revival work was completedby the above, “revival” is changed to “no setting.”

Example 3 Example Changing Reference

When “changing reference destination information” is “changing to recordwith ID=X (X is explanatory ID: major key)”, the corresponding changingprocess is to change reference to this record to the specified record.That is, reference to this record from sub table will be changed toreference to the record with X.

At the first time, record with ID=c in sub table 0801 of FIG. 8 refersrecord with ID=3 of main table A 0802. “Changing reference destinationinformation” of this record is “to change to record=5”. And, “3”, thatis a ID of A, is changed to “5” at “term n” of record with ID=c in subtable. It means that reference by record with ID=c is changed to ID=5.

<Preventing Circulation of Reference Change>

If the main table is changed drastically, circulation may occur inconversion of reference. In this case, circular reference can beprevented by the following method. First both conventional and new maintables are prepared. And switch reference to the conventional main tableto reference to the new main table.

If changing reference destination information is; “Tablespecification=S” (S is temporary table name for explanation)+“Newrecord=Y” (Y is temporary ID: major key for explanation), thecorresponding process to change reference destination is to changereference to this record into reference to record Y in the specifiedtable S.

At the beginning, record with ID=d of sub table 0801 of FIG. 8, refersto 4 (record with ID=4) of main table A 0802. “Changing referencedestination information” of this record is “main table B” and “change torecord=1”. And, a reference destination should be set to record withID=1 of main table B 0803, and value of “term n” 0804 of a record withID=d in sub table is rewritten.

Although FIG. 8 shows both references destination changes to same tableor to other tables for explanation, most of current RDBs haverestriction that only one table is referred by a term of sub table.Therefore, it is practical to set restriction that RBD software refersonly new main table of after conversion and that the former main tableshould be accessed by a program base on the present invention.

Example 4 Logic of Changing Reference Destination

When changing reference destination information is “another record ofthe same table”+“logic of changing reference destination=Z” (Z is atemporary label of logic for explanation), or when changing referencedestination information is “record of another table”+“logic of changingreference destination=Z”, changing logic of reference destination is thefollowing. When this record of the main table is referred from a subtable, invoke logic specified by Z, and by the result change referencedestination of the referring record.

Record with ID=e of a sub table of FIG. 9 refers to the record withID=11 of main table A at the beginning. “Changing reference destinationinformation” of this record is “another record of the same table” and“Changing logic of reference destination=Z”. Thus logic Z is invoked.

FIG. 9 shows an example of logic Z as follows. First, fetch 0901 a labelof the original reference destination record, that is “Head officebuilding” in this example. Next, check 0902 whether character string,specified beforehand, for example, the “head office”, is contained ornot. If contained 0903, change 0904 reference of record with ID=e of subtable into reference to a record of ID=13 of main table A. Record ofID=f of sub table is referring to a record of ID=12 of main table A atthe beginning, it is changed into reference to a record of ID=13 of maintable A. Thus, all references to records of different expressions suchas “head office building”, “management department in head office” and“head office” of same concept, are unified to references to a record of“Head Office”.

Example 5 Reference Destination Change Using Changing Tree

When “changing reference destination information” is “node=V of achanging tree” (V is explanatory label of node), reference destinationis changes into a record specified to node V. If no record is specifiedwith node V as new changing reference destination, search higher nodesof V in order, detect first new destination record, and set it as newdestination.

At the beginning, record with ID=h of sub table of FIG. 10 refers to therecord with ID=21 of main table A. “Changing reference destinationinformation” of this record is “node=P of changing tree”. And, fetch1004 node P 1001 and check 1005 that table and record are specified atthis node. Since “ID=32 of main table B” is specified, it is set 1006 asnew reference destination of the referencing record. At the beginning,record of ID=i of sub table refers to record of ID=22 of main table A.“Changing reference destination information” of this record is “node=Qof changing tree”. And, fetch 1004 node Q 1003 and check 1005 that tableand record are specified at this node. Since node Q has nospecification, find 1007 higher node, that is node R 1002, and check1005 that table and record are specified at this node. Since there is“ID=31 of main table B”, it is set as reference destination ofreferencing record and write down it to the referencing record.

It is good idea not to show the record with “changing referencedestination information”, for avoiding setting reference to this record.In FIG. 10, main table A is not displayed but only main table B which isthe new main table is displayed. Therefore, an operator cannot choose arecord of main table A as a reference destination. In FIG. 9, recordswith ID=11 and 12 are not displayed (display=False) but only a recordwith ID=13 is displayed. That is, only “Head office” can be set as newreference destination.”

Records with “changing reference destination information” and haveproperty “display=false” will be shown for operators who manipulate ormodify them, of course.

Process of reference destination change can be done when performingreference from sub table, that is, information on a referencedestination is accessed by a program, or can be done collectively whenno higher priority processes are running.

Example 6 Version Management of DB

It is necessary to manage versions of the original DB, and base versionsof reproduction DBs, to implement the method setting priority toeditorial contents on the latest information, of the present invention.FIG. 11 explains this structure.

Original DB 1104 is placed on server 1101. Computer A 1102 hasreproduced DB 1105, and computer B 1103 has reproduced DB 1106. Versionof original DB 1104 is 0 at the beginning, and base version ofreproduced DBs are also 0. As already explained for claim 4, recordversions are recorded to each record of the original DB and reproducedDBs. Record version is a record of base version when the record iscreated newly or when corrected at least some part of it. “0” is theinitial value of record version of the original and reproduced record X.

Computer A creates reproduced DB at the first synchronization 1110, andcomputer B creates reproduced DB at the first synchronization 1111.These base versions are 0. After that, version of original DB is updatedfrom “0” to “6,” this is the result of sending up to server fromcomputers other than computers A and B. In FIG. 11, “computer A” 1102performs synchronization 1112 once again, and version of reproduced DBbecomes 1.

Now, suppose that “computer A” edits 1113 reproduced record X 1108 inreproduced DB 1105. Since a base version of reproduced DB is 1 at thistime, record version of reproduced 1108 of record X is set to 1. Thisedited record and base version of reproduced DB 1105 are sent 1114 up toserver. If said editorial contents are judged as valid at server, theoriginal DB 1104 will be updated and version of the original DB will be7. The original of record X is also updated 1115 to the contents of thatedited by “computer A”. After “computer A” receives notification thatthe editorial contents become valid 1116 from server, synchronize 1116is performed, and base version of reproduced DB of “computer A” becomes7.

When program treat a record, program also checks reference destinationrecord of the record. If there is “changing reference destinationinformation”, reference destination of the record is changed. Since somecontents of the record are changed by changing this referencedestination, record version is set to the base version of that time.Changing reference destination information, specified by earlierversions, that are earlier than the version recorded on this record, hasbeen already confirmed. When changing reference destination by changingreference destination information, changing reference destinationinformation that are set after record version recorded are used, inorder from the older one.

Thereby, change of reference destination is made without inconsistency.

On the other hand, computer B performs synchronization 1117 at the timeof version 6 of the original DB 1104, and a version of reproduction DB1106 is set to 6. Next, (reproduced) record X 1109 will be edited 1118.At this time, record version is set to 6 and is sent 1119 up to server.And collision of editing works to record X is found by inspection byserve, because editorial contents (to record X) by “computer A” is sentup after the synchronization 1117 of computer B just before the editingwork.

Base version of editing contents that is sent-up by “computer A” is 1(record version of the original of record X is 1), and base version ofediting contents that is sent-up by computer B is 6 (record version of areproduced record X edited by computer B is 6). Therefore, editing workby computer B is adopted and the original of record X is changed 1119 tothe editorial contents made by computer B. At this time, version oforiginal DB changes to 8. Receiving confirmation that “the editorialcontents become valid” 1121 from server, computer B synchronize, andbase version of reproduced DB of computer B becomes 8.

And, suppose that computer A performs synchronization 1120 with theoriginal DB.

At this time, contents of record X, edited by computer B and becomesvalid, propagate to the reproduced DB of “computer A”. That is, theprevious edit by computer A becomes invalid at reproduced DB of“computer A” (at this time). Furthermore, additional mechanism isrequired in order to tell an operator that former edit became invalid.

INDUSTRIAL APPLICABILITY

Not only editing process of DB becomes high-speed, the present inventionmakes possible parallel DB, that is, plural computers make copies of theoriginal DB, edit on them and reflect them to the original DB. Thismeans that continuation of a process is possible, where connection withserver is impossible. It is applicable to mobile DB access and missioncritical business. It also meets a demand reducing time, effort andexpense to connect with a communications network. Almost on-line oralmost off-line operations can be chosen depending on each contents ofprocess of any computer. Furthermore, big flexibility is given to DBoperation, since computers of almost on-line or almost off-line can worktogether via a server.

1. (canceled)
 2. A method to change a reference among records of adatabase, comprising; (B) a process to change a “reference of areferring record to a currently referenced record”, when accessing saidreferring record, based on a “information that specifies a new recordreferenced to” recorded to said currently referenced record. 3.(canceled)
 4. A method to change a reference among records of adatabase, comprising; (D) a process, if “delete make” corresponding to areferenced record is found when accessing referencing record that referssaid referenced record, to remove said “delete mark”.
 5. (canceled)
 6. Adatabase management method editing reproduced database that is a copy ofwhole or some part of original database and updating the originaldatabase by results of said editorial contents, (E) a process to set aversion of the original database to a version of reproduced databasewhen the contents of the reproduced databases are coincided withcontents of the original database, (F) a process to set said version ofsaid reproduced database to an edited record when editing said record.7. A method to manage database, according to claim 6, comprising; (A1) aprocess to edit of recording “information that specifies a new recordreferenced to” corresponding to a currently referenced record, and toset said editorial contents invalid if it is impossible to confirm thatsaid edit becomes valid at the original database, (B1) a process tochange a “reference of a referring record to a currently referencedrecord”, when accessing said referring record, based on valid“information that specifies a new record referenced to” recorded to saidcurrently referenced record.
 8. A method to manage database, accordingto claim 6, comprising; (A1) a process to edit of recording “informationthat specifies a new record referenced to” corresponding to a currentlyreferenced record, and to set said editorial contents invalid if itcannot confirm that said edit becomes valid at the original database,(B2) a process to change a “reference of a referring record to acurrently referenced record”, when accessing said referring record,based on valid “information that specifies a new record referenced to”recorded to said currently referenced record. And at that time, recordversion of reproduced DB to said record.
 9. A method to manage database,according to claim 8, comprising; (B3) a process to confirming thatthere is no change by a “reference of a referring record to saidcurrently referenced record” and set version of reproduced database atsaid confirming time as version of said referencing record, whenaccessing said referring record, based on valid “information thatspecifies a new record referenced to” recorded to said currentlyreferenced record.
 10. A method to manage database, according to claim6, comprising; (H) a process to set an identification to a newly createdrecord, according to “record keeping identifications for newly createdsingular or plural number of records”, and (I) a process to do edit thatassign new identifications to said “record keeping identifications fornewly created singular or plural number of records”, and to set saidedit invalid if it is impossible to confirm that said edit becomes validat the original database.